<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitUpdate10 extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('boxes', function (Blueprint $table) {
            $table->integer('free_tips_limit')->nullable()->comment('摇一摇提示限制次数');
            $table->boolean('is_show_box')->default(1)->comment('是否显示提示卡');
            $table->boolean('is_exclude_box')->default(1)->comment('是否显示排除卡');

            $table->integer('last_hidden_sales_index')->default(0)->after('sales')->comment('上一次开出隐藏款的销量位置');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('boxes', function (Blueprint $table) {
            $table->dropColumn('free_tips_limit');
            $table->dropColumn('is_show_box');
            $table->dropColumn('is_exclude_box');
            $table->dropColumn('last_hidden_sales_index');
        });
    }
}
